package com.ichir.projects.uiflow.internal.impl;

import java.util.Map;

import com.ichir.projects.uiflow.AbstractUiView;
import com.ichir.projects.uiflow.ApplicationContext;
import com.ichir.projects.uiflow.ui.api.IUiAction;

/**
 * Default {@link IUiAction} implementation with a single eventId.
 * @author mahieddine
 * @since 1.0.0
 */
public class DefaultUiViewImpl extends AbstractUiView {

	/**
	 * Unique action event ID.
	 */
	private String eventId;
	
	/**
	 * @return the eventId
	 */
	public String getEventId() {
		return eventId;
	}

	/**
	 * Base constructor.
	 * @param eventId action event ID
	 */
	public DefaultUiViewImpl(String eventId) {
		this.eventId = eventId;
	}
	
	@Override
	public void initializeView(ApplicationContext context,
			Map<String, Object> attributes) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void refreshView(ApplicationContext context,
			Map<String, Object> attributes) {
		fireEvent(eventId);
	}

	@Override
	public void showView(ApplicationContext context,
			Map<String, Object> attributes) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void disposeView(ApplicationContext context,
			Map<String, Object> attributes) {
		// TODO Auto-generated method stub
		
	}
}
